In this session, you will go through a series of steps to learn how to run MPL on a sample model. By the end of the session, you will be able to start MPL, load and solve the model, and view the solution. At that point, you will learn how you can change option settings for MPL through dialog boxes. A brief outline of the MPL Help System is also covered at the end of this session. You will now go through each step in detail using the formulation of a sample model.
There are four simple steps you need to be familiar with in order to solve models in MPL:
Starting MPL is simple in Windows. When you installed MPL, the installation program created an entry in the Start menu under Programs for MPL for Windows. If MPL has not been installed, please refer to Chapter 2 for information on how to install the software. To start MPL, click the Start button from the task bar that appears along the bottom of the screen and select Programs/MPL for Windows.
Step 1: Start the MPL ApplicationMPL for Windows in the Start Menu
After starting MPL, the next step is to load a model file in the model editor. The MPL application comes with several sample models that are installed in the Mplwin4 directory. MPL models are stored as standard text files and typically have the file extension '.mpl'. The model we are using in this session is called Model1.mpl and is stored along with other models for this tutorial in a separate folder called Tutorial.
The Open File Dialog Box
This will open a new model editor window containing the formulation for the model.
Model Editor Window with the Model1.mpl model file
In this tutorial you will be using the CPLEX solver, but if you have another solver installed that is supported by MPL, you can use that one instead.
When you run MPL for the first time after installing it, MPL will automatically try to locate any solvers that you have available. You can see which solvers have been set up for MPL by going to the Run menu. Each solver found will be listed in the menu with the word Solve in front of it.
If you do not have any solvers available you will see the item No Solvers in the Run menu. In this case refer to Chapter 2.3: Setting up Solvers for MPL for information on how to add solvers to MPL. The rest of this tutorial will assume that you have successfully installed CPLEX or some other solver and it has been set up correctly.
The next step is to solve the model that you have loaded into the model editor. To solve the model follow these steps:
The Status Window for the Model1 Model
The Status Window provides you with information such as the number of lines read, the number of variables and constraints encountered, and how much memory has been used. While the optimizer is solving the model, the number of iterations and the current value of the objective function are also shown. The figure above shows the Status Window after the problem has been solved.
Step 4: View the SolutionMPL sends the solution to a file with same name as the model file, but with the file extension '.sol'. Use the following steps to view the solution file Model1.sol that was generated for the model you just solved:
View Window with the Solution File 'Model1.sol'
MPL also allows you to view all of the defined items from the model formulation in a hierarchical tree window called the Model Definitions window . Each branch corresponds to a section in the model.
If the tree window is not open, you can open it by choosing Model Definitions from the View menu. While working in MPL it is normally good idea to leave the window open at all times. MPL will then automatically update its contents every time you solve your model.
The tree window provides easy access to different areas of the model and allows you to quickly view selected parts of the solution from the model. To use the tree window do the following:
The Model Definitions Tree Window
View Window with the Solution Values for the Produce Variable
MPL offers the user an extensive help system containing useful information on how to use the software.
To open the main help system window for MPL, go to the Help menu and choose Topics. This will display the help window, shown below, where you can select the help topic you wish to read.
The Help Contents Window for MPL
The MPL Help Topics dialog box contains three tabs; the Contents tab, the Index tab, and the Find tab, giving you different ways of accessing the help.
The Contents tab, shows all the available topics in the help system in a hierarchical tree structure.
The Index tab, enables the user to access a list of all the keywords in the help file or to perform a search for a specific keyword.
The Find tab, enables the user to find a help topic by searching for specific words or phrases in the text. The Find database is built the first time you select the Find tab through the Find Setup Wizard.
One of the beneficial features in Windows is the addition of context sensitive help for dialog boxes. This feature enables you to quickly get specific help information about the dialog box item you are interested in. To learn how to use the context sensitive help in MPL follow these steps:
Context Sensitive Help for Dialog Box
You can also display the context sensitive help by pressing the right mouse button on the item in the dialog box and then select What's This? from the pop up menu.